<!DOCTYPE html>
<html lang="zh-cn">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>我的会员卡</title>
	<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport">
	<meta content="yes" name="apple-mobile-web-app-capable">
	<meta content="black" name="apple-mobile-web-app-status-bar-style">
	<meta content="telephone=no" name="format-detection">
	<link href="/carworld_weixin/bootstrap/css/bootstrap.min.css" rel="stylesheet">
	<link href="/carworld_weixin/css/card-style.css" rel="stylesheet">
	<link href="/carworld_weixin/css/share.css" rel="stylesheet" />
	<link href="/carworld_weixin/css/loader.min.css" rel="stylesheet">
	<script src="/carworld_weixin/js/jquery-3.3.1.min.js"></script>
	<style type="text/css">
		.tb960x90 {
			display: none !important;
			display: none
		}
		.box1,.box2,.box3,.box4{ width:400px; height:200px; margin:0 auto; border:1px solid #666}
		.box1{background:url(../images/received_card.jpg)}
	</style>

</head>
<body>

<section class="aui-flexView">
	<header class="aui-navBar aui-navBar-fixed b-line">
		<a href="javascript:history.back(-1);" class="aui-navBar-item">
			<i class="icon icon-return"></i>
		</a>
		<div class="aui-center">
			<span class="aui-center-title">我的会员卡</span>
		</div>
		<!--<a href="javascript:;" class="aui-navBar-item">-->
			<!--<i class="icon icon-share"></i>-->
			<!--<span>规则</span>-->
		<!--</a>-->
	</header>
	<section class="aui-scrollView">
		<div class="aui-tab" data-ydui-tab="">
			<div class="aui-item-ofl">
				<ul class="tab-nav">
					<li class="tab-nav-item">
						<a href="/carworld_weixin/pages/page_userCard/myVipCard.html">
							<i class="icon "></i>
							可使用
						</a>
					</li>
					<li class="tab-nav-item ">
						<a href="/carworld_weixin/pages/page_userCard/shareVipCard.html">
							<i class="icon "></i>
							已过期
						</a>
					</li>
					<li class="tab-nav-item tab-active">
						<a href="/carworld_weixin/vipcard/mycard">
							<i class="icon "></i>
							我的卡片
						</a>
					</li>
				</ul>
			</div>
			<!-- 提示语 -->
			<div id="marker"></div>

			<!--会员卡分享提示页面  -->
			<div id="share_reminder" style="" onclick="document.getElementById('share_reminder').style.display=''">
				<img src="/carworld_weixin/images/share_reminder.png">
			</div>


			<div class="tab-panel">
				<div>
					<div class="panel panel-default">
						<div class="panel-body"  style="padding:6px">
							<div class="aui-flex-box">
								<h style="color:#666"><b>卡主: <em id="namecard"></em></b>&nbsp;&nbsp;&nbsp;<b>卡号: <em id="cardNumb"></em></b></h>
							</div>
						</div>
					</div>
				</div>
				<div class="tab-panel-item tab-active">
					<div class="box1" style="width: 100%;background-size: 100% 100%;">
						<p style="color: white;margin-left: 11%;margin-top: 45%"></p>
					</div >
					<div class="tab-item">
					</div>
				</div>
			</div>
		</div>
			<br><br><br><br><br><br>

	</section>

</section>
<footer class="aui-footer aui-footer-fixed">
	<a href="/carworld_weixin/" class="aui-tabBar-item">
					<span class="aui-tabBar-item-icon">
						<i class="glyphicon glyphicon-home"></i>
					</span>
		<span class="aui-tabBar-item-text">首页</span></span><span class="aui-tabBar-item-text">home</span>

	</a>
	<a href="/carworld_weixin/pages/page_userCard/myVipCard.html" class="aui-tabBar-item ">
					<span class="aui-tabBar-item-icon">
						<i class="glyphicon glyphicon-heart"></i>
					</span>
		<span class="aui-tabBar-item-text">会员卡</span></span><span class="aui-tabBar-item-text">vip card</span>

	</a>

	<a href="/carworld_weixin/pages/page_myOrder.html" class="aui-tabBar-item ">
					<span class="aui-tabBar-item-icon">
						<i class="glyphicon glyphicon-tasks"></i>
					</span>
		<span class="aui-tabBar-item-text">订单</span></span><span class="aui-tabBar-item-text">order</span>

	</a>
	<a href="/carworld_weixin/user/userPage" class="aui-tabBar-item">
					<span class="aui-tabBar-item-icon">
						<i class="glyphicon glyphicon-user"></i>
					</span>
		<span class="aui-tabBar-item-text">我的 </span></span><span class="aui-tabBar-item-text">mine</span>

	</a>
</footer>

<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h4 class="modal-title" id="myModalLabel">将会员卡分享至：</h4>
				<div id="socialShare"></div>
			</div>
			<div class="modal-body">分享好友，共享福利</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</div>
		<!-- /.modal-content -->
	</div>
	<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<script src="/carworld_weixin/js/loading.js"></script>
<script type="text/javascript">
    //先清空之前的会员卡信息，便于重新获取
    $('.tab-item').empty();
    loading(true);
    $.ajax({
        type : 'GET',
        url : '/carworld_weixin/vipcard/myCardMessage',
        data : {
            'type' : 0
        },
        dataType : 'json',
        contentType : 'application/json',
        success : function(data) {
            console,loading(data);
            if(data.user.mobile!="" || data.user.mobile!=null){
               $("#cardNumb").append(data.user.mobile);
               $("#namecard").append(data.user.name);
			}

            var count = data.page.totalRow;
            if (0 == count) {
                $('#marker').append('<p style="text-align:center;font-size:14px;color: #dc1818;">暂时还没有可分享的会员卡套餐哦~</p>');
                loading(false);
                return;
            }
            var count = data.page.totalRow;
            var shopName=data.shop.name;
            var shareholderId = data.page.list[0].user_id;//茉德领卡的卡绑定人都为分享者不是分享者的真实股东
            var sharedUserId = data.page.list[0].user_id;

            $.each(data.page.list, function(index, elem) {
                        var html = '<a data-toggle="modal" data-target="#myModal" class="aui-flex aui-vou-content" onclick="getSharedInfo(this)"><input id="shopName" value="'+shopName+'" type="hidden" /><input id="shareholderId" value="'+shareholderId+'" type="hidden" /><input id="sharedUserId" value="'+sharedUserId+'" type="hidden" /><input id="meal_id" value="'+elem.meal_id+'" type="hidden" /><input id="meal_name" value="'+elem.meal_name+'" type="hidden" /><div class="aui-flex-box"><div class="aui-flex"><div class="aui-flex-cp-img"><img src="/carworld_weixin/images/logo.min.png" alt="">'+
                            '</div><div class="aui-flex-box" style="line-height: 1.0"><h2>' + elem.meal_name + '</h2><p><i>￥</i>' + elem.meal_price + '<em>'+elem.meal_endtime+'前</em></p></div></div></div><div class="aui-vou-button"><span>剩余' + elem.card_meal_sharenumber + '张</span><button class="aui-vou-btn-der aui-vou-btn-der-one">立即分享</button></div></a>';
                        $('.tab-item').append(html);
            });
            loading(false);
        }
    });
</script>
<script src="/carworld_weixin/js/bootstrap.min.js"></script>
<script src="/carworld_weixin/js/jweixin-1.4.0.js"></script>
<script type='text/javascript' src="/carworld_weixin/pages/js_sdk.jsp?test=false"></script>
<script type='text/javascript' src='/carworld_weixin/js/share-card.js?v=1578842452'></script>
<script type="text/javascript" src="/carworld_weixin/js/share.js?v=1578842452"></script>
<script src="/carworld_weixin/js/tab.js"></script>
</body>
</html>
